#include("/template/common/layout/_page_layout.html")
#@layout()

#define css()
<style>
    button {
        background: #758ef0;
        color: #FFF;
        border: none;
        border-radius: 15px;
    }
</style>
#end


#define content()
<div class="layui-fluid">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        #if(auth.Status=="3")
        <legend>#(name)认证正在审核中</legend>
        #else
        <legend>#(name)认证审核未通过</legend>
        #end
    </fieldset>

    <form id="person" class="layui-form x-center" action="">
        <div class="layui-form-pane">

            <div class="layui-form-item">
                <div class="layui-input-block">
                    #if(auth.Status=="3")
                    <button class="layui-btn" lay-submit lay-filter="sub" value="#(Method)">查看认证资料</button>
                    <button class="layui-btn layui-btn-warm" lay-submit lay-filter="reset" value="#(Method)">取消认证
                    </button>
                    #else
                    <p>认证未通过原因： #(auth.reply)</p>
                    <button class="layui-btn" lay-submit lay-filter="sub" value="#(Method)">重新填写提交认证</button>
                    <button class="layui-btn layui-btn-warm" lay-submit lay-filter="reset" value="#(Method)">取消本次认证
                    </button>
                    #end
                </div>
            </div>
        </div>
    </form>
</div>
#end


#define js()
<script type="text/javascript">
    layui.use(['form', 'layer'], function () {
        var layer = layui.layer
            , $ = layui.jquery
            , form = layui.form;
        form.on('submit(sub)', function (data) {
            var method = data.elem.value;
            window.location.href = '#(ctxPath)/app/organization/' + method;
            return false;
        });

        form.on('submit(reset)', function (data) {
            var method = data.elem.value;
            util.sendAjax({
                type: 'POST',
                url: '#(ctxPath)/app/organization/' + method + 'Cancel',
                data: null,
                loadFlag: true,
                success: function (data) {
                    layer.msg('取消认证成功！');
                    window.location.reload();
                    console.log(data);
                },
                error: function (data) {
                    console.log(data);
                }
            });
            return false;
        });
    });


</script>
#end